<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="__MODES__/assets/css/bootstrap.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="__CSS__/style.css" />
		<link href="__MODES__/assets/css/codemirror.css" rel="stylesheet">
		<link rel="stylesheet" href="__MODES__/assets/css/ace.min.css" />
		<link rel="stylesheet" href="__MODES__/assets/css/font-awesome.min.css" />
		<!--[if IE 7]>
		  <link rel="stylesheet" href="__MODES__/assets/css/font-awesome-ie7.min.css" />
		<![endif]-->
		<!--[if lte IE 8]>
		  <link rel="stylesheet" href="__MODES__/assets/css/ace-ie.min.css" />
		<![endif]-->
		<script src="__MODES__/assets/js/jquery.min.js"></script>

		<!-- <![endif]-->

		<!--[if IE]>
		<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
		<![endif]-->

		<!--[if !IE]> -->

		<script type="text/javascript">
			window.jQuery || document.write("<script src='__MODES__/assets/js/jquery-2.0.3.min.js'>" + "<" + "/script>");
		</script>

		<!-- <![endif]-->

		<!--[if IE]>
		<script type="text/javascript">
		 window.jQuery || document.write("<script src='__MODES__/assets/js/jquery-1.10.2.min.js'>"+"<"+"/script>");
		</script>
		<![endif]-->
		<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='__MODES__/assets/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
		</script>
		<script src="__MODES__/assets/js/bootstrap.min.js"></script>
		<script src="__MODES__/assets/js/typeahead-bs2.min.js"></script>
		<!-- page specific plugin scripts -->
		<script type="text/javascript" src="__JS__/H-ui.js"></script>
		<script type="text/javascript" src="__JS__/H-ui.admin.js"></script>
		
		<script  src="__PLUGINS__/layer/layer.js"></script>
	    <script  src="__PLUGINS__/common.js"></script>
		<title>申请通道列表</title>
	</head>

	<body>
		<div class="page-content clearfix">
			<div id="Member_Ratings">
				<div class="d_Confirm_Order_style">
					<div class="search_style">

						<ul class="search_content clearfix">
							<li><label class="l_f">通道名称</label><input name="keywords" id="keywords" type="text" class="text_add" placeholder="通道名称" style=" width:400px" /></li>
							<li style="width:90px;"><button type="button" id="search" class="btn_search"><i class="icon-search"></i>查询</button></li>
							<li style="width:90px;"><button type="button" id="searchAout" class="btn_search"><i class="icon-search"></i>全部</button></li>
						</ul>
						<div><a title="申请通道" href="javascript:;" onclick="add({$type})" class="btn btn-xs btn-success">申请通道</a></div>
					</div>
					<!---->
					<div class="table_menu_list">
						<table class="table table-striped table-bordered table-hover" >
							<thead>
								<tr>
									<th>ID</th>
									<th>通道名称</th>
									<th>渠道支付名称</th>
									<th>费率（扣款）</th>
									<th>申请类别</th>
									<th>申请时间</th>
									<th>控制器</th>
									<th>状态</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								{volist name='list' id='v' }
									<tr>
										<td>{$v.apply_id}</td>
										<td>{$v.apply_name}</td>
										<td>{$v.apply_qdname}</td>
										<td>{$v.apply_rate}</td>
										<td>
											{switch name="$v.apply_type" }
											    {case value="1"}信用卡申请{/case}
											    {case value="2"}网贷申请{/case}
											    {case value="3"}积分兑换{/case}
											{/switch}
										</td>
										<td>{$v.apply_time|date='Y-m-d H:i:s'}</td>
										<td>{$v.payment_controller}</td>
										<td>
											{if $v.apply_use==1}
												<a href="javascript:;" title="启用" data-url="{:Url('pacsta')}?id={$v['apply_id']}&type=0" data-confirm="您确认要设置为禁用状态吗？"  class="link-confirm btn btn-xs btn-success">启用</a>
											{else}
												<a href="javascript:;" title="禁用" data-url="{:Url('pacsta')}?id={$v['apply_id']}&type=1" data-confirm="您确认要设置为启用状态吗？"  class="link-confirm btn btn-xs btn-danger">禁用</a>
											{/if}
										</td>
										<td class="td-manage">
											<div><a title="编辑" href="javascript:;" onclick="edit('{$v.apply_id}')" class="btn btn-xs btn-success">编辑</a></div>
											<a href="javascript:;" title="删除" data-url="{:Url('pacdel')}?id={$v['apply_id']}" data-confirm="您确认要删除该跳数据吗？"  class="link-confirm btn btn-xs btn-danger">删除</a>
										</td>
									</tr>
								{/volist}
							</tbody>
						</table>
					</div>
					<div>
		                {$list->render()|raw}
		            </div>
				</div>
			</div>
		</div>
		
	</body>

</html>
<script>
	jQuery(function($) {
		
		$('#search').on('click', function() {
			var text = $('#keywords').val();
			if(text==''){
				layer.msg('请输入搜索关键词');
				return false;
			}
			window.location.href = "{:Url('Admin/Pmtapplycon/paclist')}?keywords="+text; 
		});
		
		$('#searchAout').on('click', function() {
			window.location.href = "{:Url('Admin/Pmtapplycon/paclist')}"; 
		});
		
		$('table th input:checkbox').on('click', function() {
			var that = this;
			$(this).closest('table').find('tr > td:first-child input:checkbox')
				.each(function() {
					this.checked = that.checked;
					$(this).closest('tr').toggleClass('selected');
				});

		});

		$('[data-rel="tooltip"]').tooltip({
			placement: tooltip_placement
		});

		function tooltip_placement(context, source) {
			var $source = $(source);
			var $parent = $source.closest('table')
			var off1 = $parent.offset();
			var w1 = $parent.width();

			var off2 = $source.offset();
			var w2 = $source.width();

			if(parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2)) return 'right';
			return 'left';
		}
	})
	
	function add(type) {
		layer.open({
		  type: 2,
		  title: false,
		  closeBtn: 1,
		  area: ['68%', '70%'],
shadeClose: true,
		  skin: 'yourclass',
		  content: "{:Url('pacadd')}?type="+type
		});
	}
	function edit(id) {
		layer.open({
		  type: 2,
		  title: false,
		  closeBtn: 1,
		  area: ['68%', '70%'],
shadeClose: true,
		  skin: 'yourclass',
		  content: "{:Url('pacedit')}?id="+id
		});
	}
	
</script>